﻿using J.Model;
using J.ProductGet.Application.Command.ProductLabelCommand;
using MediatR;
using SqlSugar;

namespace J.ProductGet.Application.CommandHandler.ProductLabelCommandHandler
{
    public class ProductLabelDisplayCommandHandler : IRequestHandler<ProductLabelDisplayCommand, List<ProductLabel>>
    {
        private readonly ISqlSugarClient _sqlSugarClient;
        public ProductLabelDisplayCommandHandler(ISqlSugarClient sqlSugarClient)
        {
            _sqlSugarClient = sqlSugarClient;
        }
        public async Task<List<ProductLabel>> Handle(ProductLabelDisplayCommand request, CancellationToken cancellationToken)
        {
            var list = await _sqlSugarClient.Queryable<ProductLabel>().ToListAsync();
            return list;
        }
    }
}
